package source.repo;
import java.io.Serializable;

public class Result implements Serializable {
    private static final long serialVersionUID = 1L;
    private  int code;
    private String  msg  ;
    private  Object data;
    //数据更重要
    public  static Result success(Object data){
        return ResultHandler(0,"成功",data);
    }
    public  static Result success(Object data,String msg){
        return ResultHandler(0, msg,data);
    }
    public  static Result ResultHandler(int c ,String msg , Object data){
        Result r= new Result()  ;
        r.setCode(c);
        r.setMsg(msg);
        r.setData(data);
        return r;
    }
    public int getCode() { return code; }
    public void setCode(int code) {this.code = code;  }
    public String getMsg() {return msg;}
    public void setMsg(String msg) { this.msg = msg;  }
    public Object getData() { return data; }
    public void setData(Object data) { this.data = data;}
}
